package com.zhiyou.online_mail.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.zhiyou.online_mail.model.GoodsModel;
import com.zhiyou.online_mail.service.AdminGoodsService;

/*
 * 后台商品管理的控制器
 */
@Controller
@RequestMapping("/admin/goods")
public class AdminGoodsController {
	
	@Autowired
	AdminGoodsService GoodsService;
	
	
	/*
	 * 展示商品
	 */
	@RequestMapping("index.do")
	public String goodsIndex(Model model){
		
		List<GoodsModel> list =GoodsService.queryGoodsList();
		
		model.addAttribute("goodList", list);
		
		return "admin/goods/index";
	}

	@RequestMapping("add.do")
	public String addGoods(){
		
		
		return "admin/goods/add";
	}
	
	
}
